package com.lagou.servlet;

import com.lagou.model.Request;
import com.lagou.model.Response;
import com.lagou.util.HttpProtocolUtil;

/**
 * @author Kirito
 * @description:
 * @date 2020/04/25
 */
public class LagouServlet extends HttpServlet {
    @Override
    protected void doGet(Request request, Response response) throws Exception {
        String content = "<h1>Hello, LagouServlet do GET for: " + request.getUrl() + "</h1>";
        response.outPutContent(HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content);
    }

    @Override
    protected void doPost(Request request, Response response) throws Exception {
        String content = "<h1>Hello, LagouServlet do POST</h1>";
        response.outPutContent(HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content);
    }
}
